package com.net.oil.TechnologySupport.presenter;

import com.net.oil.TechnologySupport.bean.TechnologyListBean;
import com.net.oil.TechnologySupport.contract.TechnologyListContract;
import com.net.oil.TechnologySupport.model.TechnologyListModel;
import com.net.oil.base.BasePresenter;

/**
 * 作者：lch
 * 时间：2018/4/14 0014:上午 9:11
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class TechnologyListPresenter extends BasePresenter<TechnologyListContract.View> implements TechnologyListContract.Presenter {

    private TechnologyListContract.View view;
    private TechnologyListContract.Model model;

    public TechnologyListPresenter(TechnologyListContract.View view) {
        this.view = view;
        model = new TechnologyListModel(this);
    }

    @Override
    protected void unSubscribe() {
       model.unSubscribe();
    }

    @Override
    public void getTechnologyList(int categoryId, int page, int rows) {
        model.getTechnologyList(categoryId, page, rows);
    }

    @Override
    public void getTechnologyListSuccess(TechnologyListBean technologyListBean) {
        view.getTechnologyListSuccess(technologyListBean);
    }

    @Override
    public void getTechnologyListFailed() {
        view.getTechnologyListFailed();
    }
}
